package com.starblink.android.basic.widget.dialog

import android.app.Activity
import android.view.View
import com.starblink.android.basic.databinding.DialogSubscribeFailBinding

class SubscribeFailDialog(val context: Activity,
                          val title: String ,
                          private val imageResource: Int,
                          private val tipResource: Int,
                          private val goLogin: (() -> Unit)? = null): BaseBottomSheetFragment() {
    lateinit var mBinding: DialogSubscribeFailBinding
    override fun getBindingRootView(): View {
        mBinding = DialogSubscribeFailBinding.inflate(layoutInflater)
        return mBinding.root
    }

    override fun initView() {
        mBinding.tvSubscribeTitle.text= title
        mBinding.ivSubscribeSuccess.setImageResource(imageResource)
        mBinding.tvSubscribeEmail.text = getString(tipResource)
        mBinding.clLoginBtn.setOnClickListener {
            //去登录
            goLogin?.invoke()
            dismiss()
        }
        mBinding.ivClose.setOnClickListener {
            //关闭
            dismiss()
        }
    }
}